export const formatNumber = (num: number): string => {
  const isPositive = num >= 0;

  const content =
    String(num)
      .replace(/[^\d]/gim, '')
      .split('')
      .reverse()
      .join('')
      .match(/.{1,3}/g)
      ?.join('\u00A0')
      .split('')
      .reverse()
      .join('') || '0';

  if (isPositive) return content;
  else return `-\u00A0${content}`;
};
